<template>
  <div class="cookbookBox" v-if="cookbook.recipe.as != 0">
    <div class="header" v-if="navState === 1">
      <div class="back" @click="back">
        <van-icon name="arrow-left" size="25" color="white" />
      </div>
      <div class="user"></div>
      <div class="wechat-moments">
        <van-icon name="wechat-moments" size="25" color="white" />
      </div>
      <div class="wechat">
        <van-icon name="wechat" size="25" color="white" />
      </div>
      <div class="more">
        <van-icon name="ellipsis" size="25" color="white" />
      </div>
    </div>
    <div
      class="header"
      v-else-if="navState == 2"
      style="background-color: white; background-image: none"
    >
      <div class="back" @click="back">
        <van-icon name="arrow-left" size="25" color="black" />
      </div>
      <div class="user"></div>
      <div class="wechat-moments">
        <van-icon name="wechat-moments" size="25" color="black" />
      </div>
      <div class="wechat">
        <van-icon name="wechat" size="25" color="black" />
      </div>
      <div class="more">
        <van-icon name="ellipsis" size="25" color="black" />
      </div>
    </div>
    <div
      class="header"
      v-else-if="navState == 3"
      style="background-color: white; background-image: none"
    >
      <div class="back" @click="back">
        <van-icon name="arrow-left" size="25" color="black" />
      </div>
      <div class="user">
        <div class="avatar" @click="toUser(cookbook.recipe.user.user_id)">
          <van-image
            round
            width="30px"
            height="30px"
            :src="cookbook.recipe.user.user_photo"
            lazy-load
          />
        </div>
        <div
          v-if="!isFollow"
          class="follow"
          @click="follow(cookbook.recipe.user.user_id)"
        >
          关注
        </div>
        <div
          v-else
          class="noFollow"
          @click="nofollow(cookbook.recipe.user.user_id)"
        >
          已关注
        </div>
      </div>
      <div class="wechat-moments">
        <van-icon name="wechat-moments" size="25" color="black" />
      </div>
      <div class="wechat">
        <van-icon name="wechat" size="25" color="black" />
      </div>
      <div class="more">
        <van-icon name="ellipsis" size="25" color="black" />
      </div>
    </div>
    <div class="big-img">
      <van-image
        width="375px"
        height="auto"
        :src="cookbook.recipe.thumb_path"
        lazy-load
      />
      <div class="dish" v-if="cookbook.recipe.dish_count_text">
        <van-icon name="photo-o" size="20" color="white" />
        <div class="dish_count">{{ cookbook.recipe.dish_count_text }}</div>
      </div>
    </div>
    <div class="index">
      <div class="titlBox">
        <div class="title">{{ cookbook.recipe.title }}</div>
        <div class="Subtitle">
          <div class="boutique">精品 ·</div>
          <div class="exclusive">独家 ·</div>
          <div class="browse">
            浏览 {{ cookbook.recipe.views_count_text }} ·
          </div>
          <div class="browse">收藏 {{ cookbook.recipe.favo_counts_text }}</div>
        </div>
      </div>
      <div class="avatarBox" ref="avatarBox">
        <div class="left">
          <div class="avatar" @click="toUser(cookbook.recipe.user)">
            <van-image
              round
              width="42px"
              height="42px"
              :src="cookbook.recipe.user.user_photo"
              lazy-load
            />
          </div>
          <div class="nickname">{{ cookbook.recipe.user.nickname }}</div>
          <div class="lv">LV.{{ cookbook.recipe.user.lvl }}</div>
        </div>
        <div
          v-if="!isFollow"
          class="follow"
          @click="follow(cookbook.recipe.user.user_id)"
        >
          关注
        </div>
        <div
          v-else
          class="noFollow"
          @click="nofollow(cookbook.recipe.user.user_id)"
        >
          已关注
        </div>
      </div>
      <div class="tipsBox">
        <span
          class="tip"
          v-for="(cookstory, index) in cookbook.recipe.cookstorys"
          :key="index"
          :style="{ color: cookstory.color }"
          @click="toU(cookstory.u)"
        >
          {{ cookstory.c }}
        </span>
      </div>
      <div
        class="time-difficulty"
        v-if="
          cookbook.recipe.cook_time_image &&
          cookbook.recipe.cook_difficulty_image &&
          cookbook.recipe.cook_difficulty &&
          cookbook.recipe.cook_difficulty
        "
      >
        <div class="time">
          <van-image
            width="23px"
            height="23px"
            :src="cookbook.recipe.cook_time_image"
            lazy-load
          />
          <span>{{ cookbook.recipe.cook_time }}</span>
        </div>
        <div class="difficulty">
          <van-image
            width="23px"
            height="23px"
            :src="cookbook.recipe.cook_difficulty_image"
            lazy-load
          />
          <span>{{ cookbook.recipe.cook_difficulty }}</span>
        </div>
      </div>
      <div class="listBox">
        <div class="top">
          <div class="title">食物清单</div>
          <div v-if="addOrRemove" class="subtitle" @click="addList">
            加入采购清单
          </div>
          <div v-else class="subtitle" @click="removeList">移除采购清单</div>
        </div>
        <div class="lists">
          <div
            class="list"
            v-for="(list, index) in cookbook.recipe.major"
            :key="index"
          >
            <div class="title">{{ list.title }}</div>
            <div class="note">{{ list.note }}</div>
          </div>
        </div>
      </div>
      <div
        class="nutritionBox"
        v-if="cookbook.recipe.nutrition_facts.length > 0"
      >
        <div class="top">
          <div class="title">营养分析</div>
          <div class="subtitle">查看详情</div>
        </div>
        <div class="nutrition-facts">
          <div class="circle">
            <van-circle
              v-model:current-rate="currentRate1"
              :rate="
                (cookbook.recipe.nutrition_facts[0].calorie /
                  (cookbook.recipe.nutrition_facts[0].calorie +
                    cookbook.recipe.nutrition_facts[1].calorie +
                    cookbook.recipe.nutrition_facts[2].calorie)) *
                100
              "
              stroke-width="300"
              color="#E2483C"
              style="
                width: 64px;
                height: 64px;
                position: absolute;
                left: 0;
                top: 0;
                z-index: 3;
              "
              stroke-linecap="butt"
              layer-color="transparent"
            />
            <van-circle
              v-model:current-rate="currentRate2"
              :rate="
                ((cookbook.recipe.nutrition_facts[0].calorie +
                  cookbook.recipe.nutrition_facts[1].calorie) /
                  (cookbook.recipe.nutrition_facts[0].calorie +
                    cookbook.recipe.nutrition_facts[1].calorie +
                    cookbook.recipe.nutrition_facts[2].calorie)) *
                100
              "
              stroke-width="300"
              color="#488040"
              style="
                width: 64px;
                height: 64px;
                position: absolute;
                left: 0;
                top: 0;
                z-index: 2;
              "
              stroke-linecap="butt"
              layer-color="transparent"
            />
            <van-circle
              v-model:current-rate="currentRate3"
              :rate="100"
              stroke-width="300"
              color="#FECD4A"
              style="
                width: 64px;
                height: 64px;
                position: absolute;
                left: 0;
                top: 0;
                z-index: 1;
              "
              stroke-linecap="butt"
              layer-color="transparent"
            />
          </div>
          <div class="right">
            <div class="left">
              <div
                class="nutrition"
                v-for="(nutrition, index) in cookbook.recipe.nutrition_facts"
                :key="index"
              >
                <div
                  class="pie_chart"
                  :style="{ backgroundColor: nutrition.pie_chart_color }"
                ></div>
                <div class="nutrient">{{ nutrition.nutrient }}</div>
                <div class="amount">{{ nutrition.amount }}</div>
              </div>
            </div>
            <div class="energyBox">
              <div class="energy">{{ cookbook.recipe.energy }}</div>
              <div class="kilocalorie">千卡</div>
            </div>
          </div>
        </div>
        <a class="buttom" :href="cookbook.recipe.nutrition_facts_hint_text_url">
          <van-icon name="bulb-o" size="12" />
          <div>{{ cookbook.recipe.nutrition_facts_hint_text }}</div>
        </a>
      </div>
      <div class="cookstepBox">
        <div class="top">
          <div class="title">烹饪步骤</div>
          <div class="subtitle">点击图片进入烹饪模式</div>
        </div>
        <div class="cooksteps">
          <div
            class="cookstep"
            v-for="(step, index) in cookbook.recipe.cookstep"
            :key="index"
          >
            <div
              class="position"
              v-if="step.position < cookbook.recipe.cookstep.length"
            >
              步骤{{ step.position }}/{{ cookbook.recipe.cookstep.length }}
            </div>
            <div v-else class="position">最后一步</div>
            <van-image
              width="100%"
              height="auto"
              radius="10px"
              :src="step.image"
              lazy-load
            />
            <div class="content">{{ step.content }}</div>
          </div>
        </div>
        <div class="buttom">
          {{ cookbook.recipe.release_time }}
        </div>
      </div>
      <div class="commentBox">
        <div class="top">
          <div class="title">热门评论</div>
          <div class="subtitle">{{ cookbook.recipe.comments_count }}条评论</div>
        </div>
        <div class="doComment">
          <van-image
            width="auto"
            height="25px"
            style="margin-left: 5px; flex-shrink: 0"
            src="https://tx1.douguo.com/upload/photo/1/1/1/140_3309d49bb18e78ff5ed8f20c21b0d87b.png"
            lazy-load
          />
          <input type="text" placeholder="说点什么，让TA也认识爱做饭的你" />
        </div>
        <div class="comments">
          <div
            class="comment"
            v-for="(comment, index) in cookbookInfo.comments"
            :key="index"
          >
            <div class="top">
              <div class="left">
                <div class="avatar">
                  <van-image
                    v-if="comment.u.p"
                    width="35"
                    height="35"
                    round
                    :src="comment.u.p"
                    lazy-load
                  />
                  <van-image
                    v-else
                    width="35"
                    height="35"
                    round
                    src="https://tx1.douguo.com/upload/photo/1/1/1/70_3309d49bb18e78ff5ed8f20c21b0d87b.png"
                    lazy-load
                  />
                </div>
                <div class="nickname">{{ comment.u.n }}</div>
                <div class="prime" v-if="comment.u.is_prime">VIP</div>
                <div class="lv">LV.{{ comment.u.lvl }}</div>
              </div>
              <div class="right">
                <van-icon name="like-o" />
                <div class="like">赞</div>
              </div>
            </div>
            <div class="contentBox">
              <div class="content">{{ comment.content[0].c }}</div>
              <div
                v-if="comment.child_comments.length > 0"
                class="child_comments"
              >
                <div
                  class="child_comment"
                  v-for="(child_comment, index) in comment.child_comments"
                  :key="index"
                >
                  <div class="n">
                    <span>{{ child_comment.u.n }}</span
                    ><span
                      v-if="child_comment.u.n == cookbook.recipe.user.nickname"
                      >(作者)</span
                    >: {{ child_comment.content[0].c }}
                  </div>
                </div>
                <div v-if="comment.ccc > 2" class="ccc">
                  共{{ comment.ccc }}条回复
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="all" v-if="cookbookInfo.first_level_comment_count > 3">
          查看全部{{ cookbook.recipe.comments_count }}条评论
        </div>
      </div>
      <div class="learnBox">
        <van-icon name="photo-o" size="22" />
        <div class="learn">传学做</div>
      </div>
    </div>
    <div class="likefooter"></div>
    <div class="footer">
      <div class="left">
        <div class="doComment">说点什么...</div>
        <div class="comments">
          <van-icon name="chat-o" size="25" />
          <div>{{ cookbook.recipe.comments_count }}</div>
        </div>
      </div>
      <div class="right">
        <div
          style="margin-right: 15px"
          @click="doCollect(cookbook.recipe.cook_id)"
        >
          <van-icon v-if="!isCollect" name="star-o" size="25" />
          <van-icon v-else name="star" size="25" color="#ffc632" />
          <div v-if="!isCollect">收藏</div>
          <div v-else>已收藏</div>
        </div>
        <div>
          <van-icon name="photo-o" size="25" />
          <div>传学做</div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { useRouter } from "vue-router";
import { useDouguoStore } from "@/stores/douguo";
import { storeToRefs } from "pinia";
import { onMounted, onBeforeUnmount, ref, type Ref } from "vue";
import router from "@/router";

const currentRate1 = ref(0);
const currentRate2 = ref(0);
const currentRate3 = ref(0);

const back = () => {
  history.go(-1);
};

const douguo = useDouguoStore();

const { cookbook, cookbookInfo } = storeToRefs(douguo);
const { updataCookbook, updataCookbookInfo } = douguo;

const route: object = useRouter();
// console.log(router.currentRoute.value.query);

updataCookbook(route.currentRoute.value.query.id);
updataCookbookInfo(route.currentRoute.value.query.id);

const navState: Ref<number> = ref(1);

const avatarBox = ref<HTMLElement>();

const handleScroll = () => {
  // console.log(window.scrollY);
  if (window.scrollY <= 180) {
    // console.log(123);
    navState.value = 1;
  } else if (window.scrollY < avatarBox.value?.offsetTop) {
    navState.value = 2;
  } else {
    navState.value = 3;
  }
};

onMounted(() => {
  // chrome
  document.body.scrollTop = 0;
  // firefox
  document.documentElement.scrollTop = 0;
  // safari
  window.pageYOffset = 0;

  window.addEventListener("scroll", handleScroll);

  if (localStorage.getItem("collect")) {
    if (
      JSON.parse(localStorage.getItem("collect") || "[]").indexOf(
        Number(route.currentRoute.value.query.id)
      ) == -1
    ) {
      isCollect.value = false;
    } else {
      isCollect.value = true;
    }
    // console.log(isCollect.value);
  }
});

onBeforeUnmount(() => {
  window.removeEventListener("scroll", handleScroll); // 离开当前组件别忘记移除事件监听
});

const toUser = (user: object) => {
  // console.log("toUser");
  if (user.nick != "用户已注销") {
    router.push({
      path: "/user",
      query: { id: user.user_id },
    });
  } else {
    window.alert("用户已注销");
  }
};

const isCollect: Ref<boolean> = ref(false);
// if (
//   JSON.parse(localStorage.getItem("collect") || "[]").indexOf(
//     route.currentRoute.value.query.id
//   ) != -1
// ) {
//   isCollect.value = true;
// }

const doCollect = (id: string) => {
  // console.log("doCollect", Number(id));
  let collects = ref(JSON.parse(localStorage.getItem("collect") || "[]"));
  if (collects.value.indexOf(id) == -1) {
    collects.value.push(id);
    localStorage.setItem("collect", JSON.stringify(collects.value));
    isCollect.value = true;
  } else {
    localStorage.setItem(
      "collect",
      JSON.stringify(collects.value.filter((o: string) => o != id))
    );
    isCollect.value = false;
  }
};

const toU = (u: string) => {
  if (u) {
    console.log("toU", u);
  }
};

const addOrRemove = ref(true);

onMounted(() => {
  if (
    JSON.parse(localStorage.getItem("shoppingList") || "[]").indexOf(
      route.currentRoute.value.query.id
    ) != -1
  ) {
    addOrRemove.value = false;
  }

  if (
    JSON.parse(localStorage.getItem("collect") || "[]").indexOf(
      route.currentRoute.value.query.id
    ) != -1
  ) {
    isCollect.value = true;
  }
});

const addList = () => {
  // console.log("addList", cookbook.value.recipe.cook_id);
  // addToShoppingList(cookbook.value.recipe.cook_id);
  let list = new Set(JSON.parse(localStorage.getItem("shoppingList") || "[]"));
  // console.log(list);
  list.add(cookbook.value.recipe.cook_id);
  localStorage.setItem("shoppingList", JSON.stringify(Array.from(list)));

  addOrRemove.value = false;
};
const removeList = () => {
  // console.log("removeList", cookbook.value.recipe.cook_id);
  // removeFromShoppingList(cookbook.value.recipe.cook_id);
  const list = JSON.parse(localStorage.getItem("shoppingList") || "[]").filter(
    (o: string) => o != cookbook.value.recipe.cook_id
  );
  // console.log(list);
  localStorage.setItem("shoppingList", JSON.stringify(list));

  addOrRemove.value = true;
};

const isFollow: Ref<boolean> = ref(false);

if (
  JSON.parse(localStorage.getItem("follow") || "[]").indexOf(
    route.currentRoute.value.query.user_id
  ) != -1
) {
  isFollow.value = true;
}

const follow = (id: string) => {
  console.log("follow", id);
  let follows = new Set(JSON.parse(localStorage.getItem("follow") || "[]"));
  follows.add(id);
  localStorage.setItem("follow", JSON.stringify(Array.from(follows)));
  isFollow.value = true;
};

const nofollow = (id: string) => {
  console.log("follow", id);
  let follows = JSON.parse(localStorage.getItem("follow") || "[]").filter(
    (o: string) => o != id
  );
  localStorage.setItem("follow", JSON.stringify(Array.from(follows)));
  isFollow.value = false;
};
</script>

<style lang="scss" scoped>
.cookbookBox {
  background-color: white;

  .header {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 50px;
    display: flex;
    align-items: center;
    z-index: 10;
    background-image: linear-gradient(
      rgba(0, 0, 0, 0.4),
      rgba(255, 255, 255, 0)
    );

    .back {
      margin-left: 15px;
      cursor: pointer;
    }

    .user {
      width: 130px;
      height: 100%;
      background-color: transparent;
      margin-left: 24px;
      display: flex;
      align-items: center;
      justify-content: space-between;

      .avatar {
        height: 30px;
        width: 30px;
        cursor: pointer;
      }

      .follow {
        width: 78px;
        height: 30px;
        text-align: center;
        line-height: 30px;
        border-radius: 15px;
        background-color: #ffc632;
        font-size: 16px;
        cursor: pointer;
      }

      .noFollow {
        width: 78px;
        height: 30px;
        text-align: center;
        line-height: 30px;
        border-radius: 15px;
        font-size: 16px;
        color: #999;
        background-color: #fafafa;
        cursor: pointer;
      }
    }

    .wechat-moments {
      margin-left: 30px;
    }

    .wechat {
      margin-left: 30px;
    }

    .more {
      margin-left: 30px;
    }
  }

  .big-img {
    margin-bottom: 20px;
    position: relative;

    .dish {
      position: absolute;
      right: 20px;
      bottom: 20px;
      background-color: rgba(0, 0, 0, 0.4);
      display: flex;
      align-items: center;
      border-radius: 5px;
      padding: 5px;

      .dish_count {
        margin-left: 5px;
        font-size: 14px;
        color: white;
      }
    }
  }

  .index {
    padding: 0 25px;

    .titlBox {
      display: flex;
      flex-direction: column;
      margin-bottom: 40px;

      .title {
        font-size: 23px;
        font-weight: bold;
        margin-bottom: 12px;
      }

      .Subtitle {
        display: flex;
        align-items: center;

        div {
          font-size: 12px;
          color: #999;
          margin-right: 5px;
        }
      }
    }

    .avatarBox {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 30px;

      .left {
        display: flex;
        align-items: center;

        .avatar {
          margin-right: 9px;
          cursor: pointer;
        }

        .nickname {
          font-size: 16px;
          margin-right: 5px;
          height: 22px;
          line-height: 22px;
        }

        .lv {
          font-size: 12px;
          color: #c9a63b;
          font-style: italic;
        }
      }

      .follow {
        width: 78px;
        height: 30px;
        text-align: center;
        line-height: 30px;
        border-radius: 15px;
        background-color: #ffc632;
        font-size: 16px;
        cursor: pointer;
      }

      .noFollow {
        width: 78px;
        height: 30px;
        text-align: center;
        line-height: 30px;
        border-radius: 15px;
        font-size: 16px;
        color: #999;
        background-color: #fafafa;
        cursor: pointer;
      }
    }

    .tipsBox {
      white-space: pre-wrap;
      font-size: 18px;
      margin-bottom: 30px;
    }

    .time-difficulty {
      display: flex;
      align-items: center;
      justify-content: space-around;
      margin-bottom: 30px;

      > div {
        display: flex;
        align-items: center;

        > span {
          margin-left: 12px;
          font-size: 18px;
        }
      }
    }

    .listBox {
      margin-bottom: 30px;

      .top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 15px;

        .title {
          font-size: 18px;
          line-height: 24px;
          font-weight: bold;
        }

        .subtitle {
          font-size: 14px;
          color: #4d9aa1;
          line-height: 19px;
          cursor: pointer;
        }
      }

      .lists {
        display: flex;
        flex-direction: column;

        .list {
          height: 36px;
          display: flex;
          align-items: center;
          justify-content: space-between;
          font-size: 18px;
        }
      }
    }

    .nutritionBox {
      margin-bottom: 30px;

      .top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 15px;

        .title {
          font-size: 18px;
          line-height: 24px;
          font-weight: bold;
        }

        .subtitle {
          font-size: 14px;
          color: #4d9aa1;
          line-height: 19px;
          cursor: pointer;
        }
      }

      .nutrition-facts {
        display: flex;
        align-items: center;
        margin-bottom: 15px;

        .circle {
          width: 64px;
          height: 64px;
          position: relative;
          flex-shrink: 0;
        }

        // .likeCircle {
        //   width: 64px;
        //   height: 64px;
        // }

        .right {
          display: flex;
          justify-content: space-between;
          align-items: center;
          width: 100%;

          .left {
            display: flex;
            flex-direction: column;
            margin-left: 10px;

            .nutrition:first-of-type {
              margin-top: 0;
            }

            .nutrition {
              display: flex;
              align-items: center;
              margin-top: 5px;

              .pie_chart {
                height: 10px;
                width: 10px;
                border-radius: 50%;
                margin-right: 12px;
              }

              .nutrient {
                width: 60px;
                font-size: 12px;
                color: #999;
                margin-right: 14px;
              }

              .amount {
                font-size: 12px;
                font-weight: bold;
              }
            }
          }

          .energyBox {
            border-left: 3px solid #f5f5f5;
            width: 80px;
            height: 42px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;

            .energy {
              font-size: 14px;
              font-weight: bold;
            }

            .kilocalorie {
              font-size: 14px;
              color: #999;
            }
          }
        }
      }

      .buttom {
        display: flex;
        align-items: center;
        font-size: 14px;
        color: black;

        div {
          margin-left: 5px;
        }
      }
    }

    .cookstepBox {
      margin-bottom: 30px;

      .top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 15px;

        .title {
          font-size: 18px;
          line-height: 24px;
          font-weight: bold;
        }

        .subtitle {
          font-size: 14px;
          color: #4d9aa1;
          line-height: 19px;
          cursor: pointer;
        }
      }

      .cooksteps {
        display: flex;
        flex-direction: column;

        .cookstep {
          display: flex;
          flex-direction: column;
          margin-bottom: 20px;

          .position {
            margin-bottom: 10px;
            font-size: 16px;
            font-weight: bold;
          }

          .content {
            font-size: 18px;
            margin-top: 15px;
          }
        }

        .cookstep:last-of-type {
          margin-bottom: 10px;
        }
      }

      .buttom {
        font-size: 14px;
        color: #999;
      }
    }

    .commentBox {
      margin-bottom: 30px;
      display: flex;
      flex-direction: column;

      .top {
        display: flex;
        align-items: center;
        margin-bottom: 15px;

        .title {
          font-size: 18px;
          line-height: 24px;
          font-weight: bold;
        }

        .subtitle {
          font-size: 14px;
          color: #4d9aa1;
          line-height: 19px;
          margin-left: 5px;
        }
      }

      .doComment {
        width: 100%;
        height: 44px;
        border-radius: 22px;
        background-color: #f5f5f5;
        display: flex;
        align-items: center;
        margin-bottom: 15px;

        input {
          width: 100%;
          background: none;
          outline: none;
          padding: 0;
          border: 0px;
          color: #a2a2a2;
          margin-left: 10px;
          font-size: 16px;
        }

        input[type="text"]:focus,
        input[type="password"]:focus {
          background: none;
          outline: none;
        }
      }

      .comments {
        .comment {
          margin-bottom: 30px;

          .top {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 8px;

            .left {
              display: flex;
              align-items: center;

              .avatar {
                margin-right: 8px;
              }

              .nickname {
                font-size: 16px;
                margin-right: 5px;
                height: 21px;
                line-height: 21px;
              }

              .prime {
                width: 25px;
                text-align: center;
                height: 16px;
                background-color: black;
                color: #c9a63b;
                font-size: 15px;
                margin-right: 5px;
                border-radius: 3px;
              }

              .lv {
                font-size: 14px;
                color: #c9a63b;
                font-style: italic;
              }
            }

            .right {
              display: flex;
              align-items: center;

              .like {
                height: 20px;
                line-height: 20px;
                margin-left: 5px;
                font-size: 14px;
              }
            }
          }

          .contentBox {
            margin-left: 50px;

            .content {
              margin-bottom: 10px;
              font-size: 14px;
            }

            .child_comments {
              border-radius: 10px;
              background-color: #f5f5f5;
              // min-height: 80px;
              padding: 10px;

              .child_comment {
                display: flex;
                align-items: center;
                flex-wrap: wrap;
                margin-bottom: 20px;

                .n {
                  font-size: 13px;

                  span {
                    font-size: 15px;
                    font-weight: bold;
                  }
                }
              }

              .ccc {
                font-size: 14px;
                color: #999;
              }
            }
          }
        }
      }

      .all {
        align-self: center;
        font-size: 16px;
        color: #4d9aa1;
      }
    }

    .learnBox {
      width: 100%;
      height: 46px;
      border-radius: 23px;
      background-color: #ffc632;
      display: flex;
      justify-content: center;
      align-items: center;
      margin-bottom: 15px;

      .learn {
        margin-left: 10px;
        font-size: 15px;
      }
    }
  }

  .likefooter {
    height: 68px;
  }

  .footer {
    width: 100%;
    height: 68px;
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 10;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;

    .left {
      display: flex;
      align-items: center;
      margin-left: 23px;

      .doComment {
        width: 85px;
        height: 36px;
        line-height: 36px;
        border-radius: 18px;
        background-color: #f5f5f5;
        padding-left: 15px;
        font-size: 14px;
        color: #999;
      }
      .comments {
        display: flex;
        align-items: center;
        font-size: 14px;
        margin-left: 10px;

        div {
          margin-left: 5px;
          height: 19px;
          line-height: 19px;
        }
      }
    }

    .right {
      display: flex;
      align-items: center;
      margin-right: 23px;

      > div {
        display: flex;
        align-items: center;

        > div {
          font-size: 14px;
          margin-left: 5px;
          height: 19px;
          line-height: 19px;
        }
      }
    }
  }
}
</style>
